/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <iostream>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
void showInt(auto container,string sep=" ")
{
    for(auto ele:container)
    {
        cout << ele << sep;
    }
    cout <<  endl;
}
int main_10()
{
    srand((unsigned int)time(nullptr));
    vector<int> iv;
    deque<int> id;
    list<int> il;
    int random_num,stop=16;
    for (int i=0;i<stop ;i++ )
    {
        random_num=rand()%100+1;
        iv.push_back(random_num);
        id.push_back(random_num);
        il.insert(il.end(),random_num);
    }
    showInt(iv,",");
    auto iter=iv.begin();
    cout << "The first element of vector is "<<*iter << endl;
    ++iter;
    cout << "The second element of vector is "<<*iter << endl;
    --iter;
    cout << "The first element of vector is "<<*iter << endl;
    iter+=4;
    cout << "The fifth element of vector is "<<*iter << endl;
    iter=iv.begin()+iv.size()/2;
    cout << "The middle element of vector is "<<*iter << endl;
    iter=--iv.end();//a read/write iterator that points the last element in the vector
    cout << "The last element of vector is "<<*iter << endl;
    showInt(id);
	return 0;
}
